/*
 * FullArticleAction.java
 *
 * Created on 29 marzec 2007, 21:35
 *
 */

package arocms.news;

import arocms.Constans;
import arocms.business.News;
import arocms.business.NewsDAO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

/**
 *
 * @author arek
 */
public class FullArticleAction extends Action{
    
    private Logger log = Logger.getLogger(this.getClass());
    
    /** Creates a new instance of FullArticleAction */
    public FullArticleAction() {
    }

    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
        String id = request.getParameter("id");
        Long pk = new Long(id);
        News news = new NewsDAO().find(pk);
        request.setAttribute(Constans.NEWS_PATH, news);
        return mapping.findForward("success");
    }
    
    
    
}
